//
//  TableViewCell.m
//  test
//
//  Created by heew on 15/11/20.
//  Copyright © 2015年 heew. All rights reserved.
//

#import "TableViewCell.h"
#import "HYWButton.h"

@interface TableViewCell ()
@property (weak, nonatomic) IBOutlet UIView *vipCellView;
@end

@implementation TableViewCell
+ (instancetype)cellWithTableView:(UITableView *)tableView
{
    TableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"category"];
    if (cell == nil) {
        cell = [[[NSBundle mainBundle] loadNibNamed:NSStringFromClass(self) owner:nil options:nil] lastObject];
    }
    
    HYWButton *btn = [HYWButton buttonWithType:UIButtonTypeCustom];
    btn.frame = CGRectMake(20, 20, 100, 100);
    [btn setTitle:@"确定" forState:UIControlStateNormal];
    [btn setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
    [btn addTarget:cell action:@selector(vipMViewTap) forControlEvents:UIControlEventTouchUpInside];
    btn.backgroundColor = [UIColor blackColor];
    [cell.vipCellView addSubview:btn];
    
    return cell;
}

- (IBAction)vipMViewTap {
    NSLog(@"%s",__func__);
}


- (void)awakeFromNib {
    self.autoresizingMask = UIViewAutoresizingNone;
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
